import fetch from '../utils/fetch'
import config from '../utils/config'
import { querystring } from 'vux'

var BidForenoticeInvitedService = {
  getBidForenoticeInvited (providerGUID) {
    var data = {
      action: 'GetBidForenoticeInvited',
      ProviderGUID: providerGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url
    })
  },
  getBidForenoticeInvitedDetail (inviteBidForenoticeGUID, ProviderGUID) {
    var data = {
      action: 'GetBidForenoticeInvitedDetail',
      InviteBidForenoticeGUID: inviteBidForenoticeGUID,
      ProviderGUID: ProviderGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url
    })
  },
  receiverInvite: function (receiverInviteData) {
    receiverInviteData.action = 'ReceiverInvite'// 接受报名
    receiverInviteData.handleType = 'submit&add'
    var url = config.API_SERVER + '/WXApi.ajax'
    return fetch({
      url: url,
      method: 'POST',
      data: querystring.stringify(receiverInviteData),
      headers: {'Content-Type': 'application/x-www-form-urlencoded'}
    })
  }
}

export default BidForenoticeInvitedService
